#!/usr/bin/env python

# Copyright 2011 - 2012 David Selby dave6502@gmail.com

# This file is part of FX Wizard.

# FX Wizard is free software: you can redistribute it and/or modify
# it under the terms of the GNU General Public License as published by
# the Free Software Foundation, either version 3 of the License, or
# (at your option) any later version.

# FX Wizard is distributed in the hope that it will be useful,
# but WITHOUT ANY WARRANTY; without even the implied warranty of
# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
# GNU General Public License for more details.

# You should have received a copy of the GNU General Public License
# along with FX Wizard.  If not, see <http://www.gnu.org/licenses/>.

import os, pickle, time
import my_mobiler, log


"""
Small diagnostic script that screenshots MyMobiler every 2 seconds saving the
images in the 'logs' directory
"""

mobiler = my_mobiler.MyMobiler()
log_    = log.Log()

mobiler.show()
time.sleep(1)

mobiler.grabCtrl()

for i in range(30):
	print 'MyMobiler Snapshot : %s' % i
	log_.addImage(mobiler.grabImage((0, 0, 246, 404)))
	time.sleep(2)

log_.retrieveLog()
mobiler.releaseCtrl()
